package com.example.dao;

import com.example.entity.Activity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface ActivityDao {
//    List<Activity> findAll();         // 获取所有活动
//    Activity findById(Integer id);    // 根据ID查询活动
    List<Activity> findActivitiesByPage(
            @Param("startIndex") int startIndex,
            @Param("pageNum") int pageNum
    );
    int countAllActivities();


    Activity getActivityById(Integer activityId);
    int countByOrganizationId(@Param("orgId") int orgId);
    Activity findTopByOrganizationIdOrderByCreateTimeDesc(@Param("orgId") int orgId);
    Activity findLatestByOrgId(@Param("orgid") int orgId);
    int countActivitiesByOrgId(@Param("orgid") int orgId);
    int countVolunteersByOrgId(@Param("orgid") int orgId);

    int[] getMonthlyActivityData(@Param("orgid") int orgId);
    int getTotalServiceHours(@Param("orgid") int orgId);


    List<Activity> getAllActivitiesByOrgId(@Param("orgid") int orgId);
    List<Activity> getOngoingActivitiesByOrgId(@Param("orgid") int orgId);
    List<Activity> getUpcomingActivitiesByOrgId(@Param("orgid") int orgId);
    List<Activity> getCompletedActivitiesByOrgId(@Param("orgid") int orgId);

    void updateActivity(Activity activity);
    void deleteActivity(@Param("activityId") int activityId);
    void saveActivity(Activity activity);
    void createActivity(Activity activity);
    Activity getActivityById(int activityId);



}
